/**
*   \file   Square.h
*   \author Dave Reid
*   \brief  Header file for the Square class.
*/
#ifndef __EAGL_SQUARE_H_
#define __EAGL_SQUARE_H_

#include "../types.h"

namespace eagl
{

/**
*   \brief  Class representing a Square.
*
*   A Square is defined two extents. One for the width and the other for the height. The centre
*   point of the extents is considered the position of the Box.
*/
class Square
{
public:

    /**
    *   \brief  Default constructor.
    */
    Square() : m_extents(1.0f, 1.0f)
    {
    }

    /**
    *   \brief  Copy constructor.
    */
    Square(const Square &Square) : m_extents(Square.getExtents())
    {
    }

    /**
    *   \brief               Constructor.
    *   \param  extents [in] The extents of the Square.
    */
    Square(const vec2 &extents) : m_extents(extents)
    {
    }


    /**
    *   \brief  Retrieves the extents of the Square.
    *   \return The extents of the Square.
    */
    const vec2 & getExtents() const
    {
        return this->m_extents;
    }

    /**
    *   \brief               Sets the extents of the Square.
    *   \param  extents [in] The extents of the Square.
    */
    void setExtents(const vec2 &extents)
    {
        this->m_extents = extents;
    }

    /**
    *   \brief              Sets the extents of the Square.
    *   \param  width  [in] The width of the Square.
    *   \param  height [in] The height of the Square.
    */
    void setExtents(float width, float height)
    {
        this->m_extents.x = width;
        this->m_extents.y = height;
    }


private:

    /// The extents of the Square. This is essentially the width and height of the Square.
    vec2 m_extents;
};

}


#endif  // __EAGL_SQUARE_H_